import java.sql.SQLException;

import javax.jws.WebService;

@WebService(targetNamespace="http://localhost:63081/calculatePrice")
public class CalculatePriceService {

	public String calculatePrice(String projectID) throws SQLException
	{
		double sumCosts = 0;

		/*call Method to sum up the real costs for material*/
		DAO dao = new DAO();
		sumCosts += dao.calculateCosts(projectID);

		/*add costs of building*/
		System.out.println("Project-ID: " + projectID);
		System.out.println("Project-Object: " + ProjectContainer.getInstance().getProject(projectID));
		System.out.println("ProjectContainer-Size: " + ProjectContainer.getInstance().getNoOfProjects());
		sumCosts += ProjectContainer.getInstance().getProject(projectID).getPrice();

		ProjectContainer.getInstance().getProject(projectID).setPrice(sumCosts * 1.5);

		return "" + sumCosts;
	}
}
